<%@page language="java" contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="conexao.jsp" %> 

<%  String usuariolog = (String)session.getAttribute("usuario");
	if(usuariolog != null){
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Listar Manutenção</title>
        <link  href="css/geral.css" rel="stylesheet" type="text/css" />
        <link rel="shortcut icon" href="favicon.ico" />
    </head>
    <body>
        <div id="tudo">
            
            <div id="cabecalho"></div>
            
            <div id="menu">
                <jsp:include page="menuprincipal.jsp"></jsp:include>
            </div>
                  
            <div id="principal">
        
                <table border="0" align="center">
                    <tbody>
<%
    int id = Integer.parseInt(request.getParameter("id"));
    String tela;
    String modFuncao;
    String modVisual;
    String modOutras;
    String resolvido;
    
    String nome = request.getParameter("tela");

    ResultSet rs = stm.executeQuery("select * from tbmanutencao where id  = "+id);
    while(rs.next()){
        id = rs.getInt("id");
        tela = rs.getString("tela");
        modFuncao = rs.getString("modfuncao");
        modVisual = rs.getString("modvisual");
        modOutras = rs.getString("modoutras");
        resolvido = rs.getString("resolvido");
            
%>
        
                    <tr>
                        <td>ID</td>
                        <td><%=id%></td>
                    </tr>
                    <tr>
                        <td>TELA</td>
                        <td><input type="text" value="<%=tela%>" disabled="true"></input> </td>
                    </tr>
                    <tr>
                        <td>FUNÇÃO</td>
                        <td> <textarea cols="50" disabled="true"><%=modFuncao%></textarea> </td>
                    </tr>
                    <tr>
                        <td>VISUAL</td>
                        <td><textarea cols="50" disabled="true"><%=modVisual%></textarea> </td>
                    </tr>
                    <tr>
                        <td>OUTRAS</td>
                        <td><textarea cols="50" disabled="true"><%=modOutras%></textarea></td>
                    </tr>
                    <tr>
                        <td>RESOLVIDO</td>
                        <td><textarea cols="50" disabled="true"><%=resolvido%></textarea></td>
                    </tr>
                        <td> 
                            <a href="editarManutencao.jsp?id=<%=id%>&tela=<%=tela%>&modfuncao=<%=modFuncao%>&modvisual=<%=modVisual%>&modoutras=<%=modOutras%>&resolvido=<%=resolvido%>">Alterar</a>
                        </td>
                        <td>
                            <input type="hidden" name="ac" value="rm"/>
                            <a href="manterManutencao.jsp?id=<%=id%>&ac=rm">Excluir</a>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="background:#000"> </td>
                    </tr>
            
<%
    }
    rs.close();
    stm.close();
    con.close();
%>

                    </tbody>
                </table>
                <br/>
                
                <table border="0" align="center">
                    <tbody>
                        <tr>
                            <td><a href="InterfaceManutencao.jsp">Cadastrar Novo Erro</a></td>
                        </tr>
                    </tbody>
                </table>
                
            </div>
        </div>
    </body>
</html>

<% }else{
	request.getRequestDispatcher("index.jsp").forward(request, response);
};%>